// index.js
// 获取应用实例
import {
  request
} from '../../request/index'

Page({
  data: {
    // 轮播图
    swiperlist: [],
    //导航
    catelist: [],
    //楼层
    floorlist: [],
  },

  onLoad: function (options) {
    this.getSwiperList(),
      this.getCateList(),
      this.getFloorList()
  },
  //轮播图
  getSwiperList() {
    request({
      url: '/home/swiperdata'
    }).then(res => {
      console.log(res);
      this.setData({
        swiperlist: res
      })
    })
  },
  //导航
  getCateList() {
    request({
      url: '/home/catitems'
    }).then(res => {
      console.log(res);
      this.setData({
        catelist: res
      })
    })
  },
  //楼层
  getFloorList() {
    request({
      url: '/home/floordata'
    }).then(res => {
      console.log(res);
      this.setData({
        floorlist:res
      })
    })
  }
})